package com.zoroki.hmusic.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * <p>
 * 
 * </p>
 *
 * @author zoroki
 * @since 2023-05-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("favorite")
@Document(indexName = "book",createIndex = true)
public class Favorite implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 收藏id
     */
    @Id
    @TableId(value = "id", type = IdType.AUTO)
    @Field(type = FieldType.Text)
    private Integer id;


    /**
     * 用户id
     */
    @Field(analyzer="ik_max_word")
    private Integer userId;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date,format = DateFormat.basic_date_time)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @Field(type = FieldType.Date,format = DateFormat.basic_date_time)
    private LocalDateTime updatedAt;

}
